import { createBrowserRouter, Navigate } from "react-router-dom";
import App from "../view/App";
import Login from "../view/Login";
import Home from "../view/Home";
import Community from "../view/Community";
import Douyin from "../view/Douyin";
import Parts from "../view/Parts";
import My from "../view/My";
import PlayCar from "../view/PlayCar";
import Footer from "../component/Footer";
import Tell from '../view/Tell'
import Page from '../view/My_module/Page/Page'
import Music from '../view/My_module/Music/Music'
import Drive from '../view/My_module/Drive/Drive'
import Atlas from '../view/My_module/Atlas/Atlas'
import Call from '../view/My_module/Call/Call'
import Community_jing from "../view/Community_jing";
import Community_guan from "../view/Community_guan";
import Community_car from "../view/Community_car";
import Anli from '../view/dll/Anli'
import Zuisu from '../view/dll/Zuisu'
import Index from '../view/dll/Index'
import Indexs from '../view/dll/Indexs'
import Message from '../view/dll/Message'
import Pwdres from '../view/Pwdres'
import ShopCart from "../view/ShopCart";
import Community_add from "../view/Community_add"

const routre = createBrowserRouter([
    {
        path: "/",
        element: <App />,
        children: [
            {
                path: "/login",
                element: <Login />,
            },
            {
                path:'/tell',
                element:<Tell />
            },
            {
                path:'/pwdres',
                element:<Pwdres />
            },
            {
                path:'/add',
                element:<Community_add />
            },
            {
                path: "/home",
                element: <Home />,
                children: [
                    {
                        path: '/home/playCar',
                        element: <PlayCar />,

                    },
                    ,
                    {
                        path: "/home/anli",
                        element: <Anli />,
                    },
                    {
                        path: "/home/zuisu",
                        element: <Zuisu />,
                    },
                    {
                        path: "/home/Message",
                        element: <Message />,
                    },
                    {
                        path: "/home/index",
                        element: <Index />,
                    },
                    {
                        path: "/home/indexs",
                        element: <Indexs />,
                    },
                    {
                        path: "community",
                        element: <Community />,
                        children: [
                            {
                                path:'community',
                                element:<Navigate to="/community/jing" />
                            },
                            {
                                path:'jing',
                                element:<Community_jing />,
                            },
                            {
                                path:'guan',
                                element:<Community_guan />,
                            },
                            {
                                path:'car',
                                element:<Community_car />,
                            }
                     
                        ]
                    },
                    {
                        path: "douyin",
                        element: <Douyin />,
                    },
                    {
                        path: "parts",
                        element: <Parts />,
                    },
                    {
                        path:'shopcart',
                        element:<ShopCart />
                    },
                    {
                        path: "my",
                        element: <My />,
                        children:[
                            {
                                path:'page',
                                element:<Page />
                            },
                        ]
                    },
                    {
                        path: "/home",
                        element: <Navigate to="/home/playCar" />,
                    }

                ]
            },
            {
                path:'music',
                element:<Music />
            },
            {
                path:'drive',
                element:<Drive />
            },
            {
                path:'atlas',
                element:<Atlas />
            },
            {
                path:'call',
                element:<Call />
            },
            {
                path: "/",
                element: <Navigate to="/login" />,
            }
        ]
    }
])

export default routre;// src/router/index.js